From 27dfac3ff7226ed1e8c6821c91d66298510af119 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 27 Feb 2004 03:59:21 +0000 Subject: [PATCH] Fix for 904065: use .php instead of .phtml extension by default --- includes/DefaultSettings.php | 13 ++++++++----- install-utils.inc | 12 ++++++++---- install.php | 5 ++--- update.php | 6 +++--- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 19ab767bff..ea1515a41b 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -8,13 +8,17 @@ $wgVersion = "1.2.0beta"; -$wgSitename = "Wikipedia"; +$wgSitename = "MediaWiki"; # Please customize! $wgMetaNamespace = FALSE; # will be same as you set $wgSitename $wgServer = "http://" . getenv( "SERVER_NAME" ); $wgScriptPath = "/wiki"; -$wgScript = "{$wgScriptPath}/wiki.phtml"; -$wgRedirectScript = "{$wgScriptPath}/redirect.phtml"; + +# Change this and the next two to use "phtml" for compatibility with old installations +$wgScriptExtension = "php"; +$wgScript = "{$wgScriptPath}/wiki.{$wgScriptExtension}"; +$wgRedirectScript = "{$wgScriptPath}/redirect.{$wgScriptExtension}"; + $wgStyleSheetPath = "{$wgScriptPath}/style"; $wgStyleSheetDirectory = "{$IP}/style"; $wgArticlePath = "{$wgScript}?title=$1"; @@ -25,8 +29,7 @@ $wgMathPath = "{$wgUploadPath}/math"; $wgMathDirectory = "{$wgUploadDirectory}/math"; $wgTmpDirectory = "{$wgUploadDirectory}/tmp"; $wgEmergencyContact = "wikiadmin@" . getenv( "SERVER_NAME" ); -#$wgPasswordSender = "Wikipedia Mail "; -$wgPasswordSender = "Wikipedia Mail \r\nReply-To: webmaster@www.wikipedia.org"; +$wgPasswordSender = "Wikipedia Mail "; # MySQL settings # diff --git a/install-utils.inc b/install-utils.inc index 2bd3134846..8d1734e5d2 100644 --- a/install-utils.inc +++ b/install-utils.inc @@ -27,16 +27,20 @@ function install_version_checks() { } function copyfile( $sdir, $name, $ddir, $perms = 0664 ) { + copyfileto( $sdir, $name, $ddir, $name, $perms ); +} + +function copyfileto( $sdir, $sname, $ddir, $dname, $perms = 0664 ) { global $wgInstallOwner, $wgInstallGroup; - $d = "{$ddir}/{$name}"; - if ( copy( "{$sdir}/{$name}", $d ) ) { + $d = "{$ddir}/{$dname}"; + if ( copy( "{$sdir}/{$sname}", $d ) ) { if ( isset( $wgInstallOwner ) ) { chown( $d, $wgInstallOwner ); } if ( isset( $wgInstallGroup ) ) { chgrp( $d, $wgInstallGroup ); } chmod( $d, $perms ); - # print "Copied \"{$name}\" to \"{$ddir}\".\n"; + # print "Copied \"{$sname}\" to \"{$d}\".\n"; } else { - print "Failed to copy file \"{$name}\" to \"{$ddir}\".\n"; + print "Failed to copy file \"{$sname}\" to \"{$ddir}/{$dname}\".\n"; exit(); } } diff --git a/install.php b/install.php index e45b0c0d92..4aef3d8b84 100644 --- a/install.php +++ b/install.php @@ -48,9 +48,8 @@ print "Copying files...\n"; copyfile( ".", "LocalSettings.php", $IP ); copyfile( ".", "Version.php", $IP ); -copyfile( ".", "wiki.phtml", $IP ); -copyfile( ".", "redirect.phtml", $IP ); -copyfile( ".", "texvc.phtml", $IP ); +copyfileto( ".", "wiki.phtml", $IP, "wiki.$wgScriptExtension" ); +copyfileto( ".", "redirect.phtml", $IP, "redirect.$wgScriptExtension" ); copydirectory( "./includes", $IP ); copydirectory( "./stylesheets", $wgStyleSheetDirectory ); diff --git a/update.php b/update.php index e4ae1874d0..bef4e9b39a 100644 --- a/update.php +++ b/update.php @@ -72,11 +72,11 @@ exit(); function do_update_files() { global $IP, $wgStyleSheetDirectory, $wgUploadDirectory, $wgLanguageCode, $wgDebugLogFile; + global $wgScriptExtension; print "Copying files... "; - copyfile( ".", "wiki.phtml", $IP ); - copyfile( ".", "redirect.phtml", $IP ); - copyfile( ".", "texvc.phtml", $IP ); + copyfileto( ".", "wiki.phtml", $IP, "wiki.$wgScriptExtension" ); + copyfileto( ".", "redirect.phtml", $IP, "redirect.$wgScriptExtension" ); copydirectory( "./includes", $IP ); copydirectory( "./stylesheets", $wgStyleSheetDirectory ); -- 2.20.1